home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / gnu / bash / bash_108 / bash-108.zoo / bash-1.08 / cpp-Makefile.orig < prev    next >
Encoding:
Text File  |  1991-05-22  |  19.4 KB  |  637 lines

  1. /* This -*- C -*- file (cpp-Makefile) is run through the C preprocessor
  2.    to produce bash-Makefile which is machine specific.
  3.  
  4.    If you have Gcc and/or Bison, you might wish to mention that right
  5.    below here.
  6.  
  7.    Since this is to become a Makefile, blank lines which appear outside
  8.    of comments may not contain a TAB character.
  9.  
  10.    Copyright (C) 1987,1991 Free Software Foundation, Inc.
  11.  
  12.    This file is part of GNU Bash, the Bourne Again SHell.
  13.  
  14.    Bash is free software; you can redistribute it and/or modify it under
  15.    the terms of the GNU General Public License as published by the Free
  16.    Software Foundation; either version 1, or (at your option) any later
  17.    version.
  18.  
  19.    Bash is distributed in the hope that it will be useful, but WITHOUT ANY
  20.    WARRANTY; without even the implied warranty of MERCHANTABILITY or
  21.    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  22.    for more details.
  23.  
  24.    You should have received a copy of the GNU General Public License along
  25.    with Bash; see the file COPYING.  If not, write to the Free Software
  26.    Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  27. */
  28.  
  29. /**/# This Makefile is automagically made from cpp-Makefile.  You should
  30. /**/# not be editing this file; edit cpp-Makefile, machines.h, or
  31. /**/# makeargs.sh instead.  Then, assuming the edits were required to
  32. /**/# compile Bash on your system, mail the changes you had to make to
  33. /**/# bash-maintainers@ai.mit.edu.  We will do our best to incorporate
  34. /**/# them into the next release.
  35.  
  36. /* **************************************************************** */
  37. /*                                    */
  38. /*            Which compiler are you using?            */
  39. /*                                    */
  40. /* **************************************************************** */
  41.  
  42. /* Define HAVE_GCC if you have the GNU C compiler. */
  43. /* #define HAVE_GCC */
  44.  
  45. /* Define HAVE_FIXED_INCLUDES if you are using GCC with the fixed
  46.    header files. */
  47. #if defined (HAVE_GCC) && !defined (HAVE_FIXED_INCLUDES)
  48. /* #define HAVE_FIXED_INCLUDES */
  49. #endif /* HAVE_GCC && !HAVE_FIXED_INCLUDES */
  50.  
  51. /* Define HAVE_BISON if you have the GNU replacement for Yacc. */
  52. /**/# We would like you to use Bison instead of Yacc since some
  53. /**/# versions of Yacc cannot handle reentrant parsing.  Unfortunately,
  54. /**/# this includes the Yacc currently being shipped with SunOS4.x.
  55. /**/# If you do use Yacc, please make sure that any bugs in parsing
  56. /**/# are not really manifestations of Yacc bugs before you report
  57. /**/# them.
  58. #define HAVE_BISON
  59.  
  60. /**/# Can be overidden on invocation.
  61. MAKE = make
  62.  
  63. /* Where are you installing the shell? */
  64. #if defined (M_DESTDIR)
  65. DESTDIR = M_DESTDIR
  66. #else
  67. DESTDIR = /usr/gnu/bin
  68. #endif /* M_DESTDIR */
  69.  
  70. /* This includes the appropriate description for the machine that you are
  71.    using (we hope).  If the compilation doesn't work correctly, then you
  72.    will have to edit the file `machines.h' to include a description for the
  73.    machine that your Cpp uniquely identifies this as.  For example, Sun 4's
  74.    are recognized by the Cpp identifier `sparc', Vax is recognized with `vax',
  75.    etc.  The order of these files is very important.  Config.h must come last,
  76.    since it is capable of undef'ing various things. */
  77. #define BUILDING_MAKEFILE   /* Tell config.h to avoid #including anything. */
  78. #include "sysdefs.h"
  79. #include "machines.h"
  80. #include "config.h"
  81.  
  82. /**/# Here is a rule for making .o files from .c files that does not
  83. /**/# force the type of the machine (like -M_MACHINE) into the flags.
  84. .c.o:
  85.     $(RM) $@
  86.     $(CC) -c $(CFLAGS) $(CPPFLAGS) $*.c
  87.  
  88. #if defined (HAVE_BISON)
  89. BISON = bison -y
  90. #else
  91. BISON = yacc
  92. #endif
  93.  
  94. #if defined (HAVE_GCC)
  95. #if !defined (HAVE_FIXED_INCLUDES)
  96. /* This is guaranteed to work, even if you have the fixed includes!
  97.    (Unless, of course, you have the fixed include files installed in
  98.    /usr/include.  Then it will break. ) */
  99. CC = gcc -traditional -I/usr/include
  100. #else
  101. CC = gcc
  102. #endif /* !HAVE_FIXED_INCLUDES */
  103. #else
  104. CC = CPP_CC
  105. #endif /* HAVE_GCC */
  106.  
  107. /**/# Of course, you cannot do this the first time through...
  108. /**/#SHELL=/usr/gnu/bin/bash
  109. SHELL=/bin/sh
  110.  
  111. MACHINE = M_MACHINE
  112. OS = M_OS
  113.  
  114. /**/# PROFILE_FLAGS is either -pg, to generate profiling info for use
  115. /**/# with gprof, or nothing (the default).
  116. PROFILE_FLAGS=
  117.  
  118. #if defined (HAVE_SHARED_LIBS) && defined (sun)
  119. #  if !defined (HAVE_GCC)
  120. /**/# On Sun systems, we compile without shared libraries so we
  121. /**/# can debug the shell with gdb.
  122. NOSHARE = -Bstatic
  123. #  endif
  124. #endif
  125.  
  126. #if defined (SYSDEP_CFLAGS)
  127. /**/# This system has some peculiar flags that must be passed to the
  128. /**/# the C compiler (or to cpp).
  129. SYSDEP = SYSDEP_CFLAGS
  130. #endif /* SYSDEP_CFLAGS */
  131.  
  132. #if defined (SYSDEP_LDFLAGS)
  133. /**/# This system has some peculiar flags that must be passed to the
  134. /**/# the loader.
  135. SYSDEP_LD = SYSDEP_LDFLAGS
  136. #endif /* SYSDEP_LDFLAGS */
  137.  
  138. #if defined (HAVE_SETLINEBUF)
  139. /**/# This system has the setlinebuf () call.
  140. LINEBUF = -DHAVE_SETLINEBUF
  141. #endif
  142.  
  143. #if defined (HAVE_VPRINTF)
  144. /**/# This system has the vprintf () and vfprintf calls.
  145. VPRINTF = -DHAVE_VPRINTF
  146. #endif /* HAVE_VPRINTF */
  147.  
  148. #if defined (HAVE_UNISTD_H)
  149. /**/# This system has <unistd.h>.
  150. UNISTD = -DHAVE_UNISTD_H
  151. #endif
  152.  
  153. #if defined (HAVE_MULTIPLE_GROUPS)
  154. /**/# This system has multiple groups.
  155. GROUPS = -DHAVE_MULTIPLE_GROUPS
  156. #endif
  157.  
  158. #if defined (HAVE_RESOURCE)
  159. /**/# This system has <sys/resource.h>
  160. RESOURCE = -DHAVE_RESOURCE
  161. #endif
  162.  
  163. #if defined (VOID_SIGHANDLER)
  164. /**/# This system's signal () call returns a pointer to a function returning
  165. /**/# void.  The signal handlers themselves are thus void functions.
  166. SIGHANDLER = -DVOID_SIGHANDLER
  167. #endif
  168.  
  169. #if defined (HAVE_STRERROR)
  170. /**/# This system has the strerror () function.
  171. STRERROR = -DHAVE_STRERROR
  172. #endif
  173.  
  174. #if defined (HAVE_WAIT_H)
  175. /**/# This system has <sys/wait.h>
  176. WAITH = -DHAVE_WAIT_H
  177. #endif
  178.  
  179. #if defined (HAVE_GETWD)
  180. /**/# This system has the getwd () call.
  181. GETWD = -DHAVE_GETWD
  182. #endif
  183.  
  184. SYSTEM_FLAGS = $(LINEBUF) $(VPRINTF) $(UNISTD) $(GROUPS) $(RESOURCE) \
  185.        $(SIGHANDLER) $(SYSDEP) $(WAITH) $(GETWD) -D$(MACHINE) -D$(OS)
  186. DEBUG_FLAGS = $(PROFILE_FLAGS) -g
  187. LDFLAGS    = $(SYSDEP_LD) $(DEBUG_FLAGS)
  188. CFLAGS    = $(DEBUG_FLAGS) $(SYSTEM_FLAGS) -DSHELL
  189. CPPFLAGS= -I$(LIBSRC)
  190.  
  191. /**/# These are required for sending bug reports.
  192. SYSTEM_NAME = $(MACHINE)
  193. OS_NAME = $(OS)
  194.  
  195. /**/# The name of this program.
  196. PROGRAM = bash
  197.  
  198. /**/# The type of machine Bash is being compiled on.
  199. HOSTTYPE_DECL = -DHOSTTYPE='$(SYSTEM_NAME)'
  200.  
  201. /**/# The default primary and secondary prompts.
  202. PPROMPT = '"${PROGRAM}\\$$ "'
  203. SPROMPT = '"> "'
  204.  
  205. #if defined (MAINTAINER)
  206. bash_maintainer = MAINTAINER
  207. MAINTAIN_DEFINE = -DMAINTAINER='"$(bash_maintainer)"'
  208. #endif
  209.  
  210. /**/# The group of configuration flags.  These are for shell.c
  211. CFG_FLAGS = -DPPROMPT=$(PPROMPT) -DSPROMPT=$(SPROMPT) -DOS_NAME='"$(OS_NAME)"'\
  212.         -DSYSTEM_NAME='$(SYSTEM_NAME)' $(SIGLIST_FLAG) $(MAINTAIN_DEFINE)
  213.  
  214. /**/# The directory which contains the source for malloc.  The name must
  215. /**/# end in a slash, as in "./alloc-files/".
  216. ALLOC_DIR = ./alloc-files/
  217.  
  218. /**/# Our malloc.
  219. #if defined (USE_GNU_MALLOC)
  220. MALLOC = $(ALLOC_DIR)malloc.o
  221. MALLOC_FLAGS = -Drcheck -Dbotch=programming_error
  222. #endif /* USE_GNU_MALLOC */
  223.  
  224. #if !defined (HAVE_ALLOCA)
  225. ALLOCA = $(ALLOC_DIR)alloca.o
  226.  
  227. #if defined (ALLOCA_ASM)
  228. ALLOCA_SOURCE = $(ALLOC_DIR)ALLOCA_ASM
  229. #else
  230. ALLOCA_SOURCE = $(ALLOC_DIR)alloca.c
  231. #endif /* ALLOCA_ASM */
  232.  
  233. #endif /* !HAVE_ALLOCA */
  234.  
  235. ALLOC_HEADERS = $(ALLOC_DIR)getpagesize.h
  236. ALLOC_FILES = $(ALLOC_DIR)malloc.c $(ALLOC_DIR)alloca.c \
  237.           $(ALLOC_DIR)i386-alloca.s $(ALLOC_DIR)x386-alloca.s
  238.  
  239. #if !defined (HAVE_SIGLIST)
  240. /**/# If your system does not have sys_siglist, then define SIGLIST
  241. /**/# as siglist.o
  242. SIGLIST = siglist.o
  243. SIGLIST_FLAG=-DINITIALIZE_SIGLIST
  244. #endif /* HAVE_SIGLIST */
  245.  
  246. RM = rm -f
  247. AR = ar
  248.  
  249. /**/# The location of ranlib on your system.
  250. #if defined (RANLIB_LOCATION)
  251. RANLIB = RANLIB_LOCATION
  252. #else
  253. RANLIB = ranlib
  254. #endif /* RANLIB_LOCATION */
  255.  
  256. /**/# Support libraries required.  Termcap and Readline.
  257. /**/# The location of sources for the support libraries.
  258. LIBSRC = ./
  259. RLIBSRC = $(LIBSRC)readline/
  260.  
  261. RLIBDOC = $(RLIBSRC)doc/
  262.  
  263. /**/# Source, object and docuemntation of the history library.
  264. HISTORY_SOURCE    = $(RLIBSRC)history.c $(RLIBSRC)history.h
  265. HISTORY_OBJ    = $(RLIBSRC)history.o
  266. HISTORY_DOC    = $(RLIBDOC)hist.texinfo $(RLIBDOC)hsuser.texinfo \
  267.           $(RLIBDOC)hstech.texinfo
  268.  
  269. /**/# The source, object and documentation for the GNU Readline library.
  270. READLINE_SOURCE    = $(RLIBSRC)readline.c $(RLIBSRC)readline.h\
  271.           $(RLIBSRC)chardefs.h $(RLIBSRC)keymaps.h\
  272.           $(RLIBSRC)funmap.c $(RLIBSRC)emacs_keymap.c\
  273.           $(RLIBSRC)vi_keymap.c $(RLIBSRC)keymaps.c\
  274.           $(RLIBSRC)vi_mode.c $(HISTORY_SOURCE)
  275.  
  276. READLINE_OBJ    = $(RLIBSRC)readline.o $(RLIBSRC)funmap.o \
  277.           $(RLIBSRC)keymaps.o $(HISTORY_OBJ)
  278.  
  279. READLINE_DOC    = $(RLIBDOC)rlman.texinfo $(RLIBDOC)rluser.texinfo \
  280.           $(RLIBDOC)rltech.texinfo
  281.  
  282. READLINE_DOC_SUPPORT  = $(RLIBDOC)Makefile $(RLIBDOC)texinfo.tex \
  283.           $(RLIBDOC)readline.dvi $(RLIBDOC)readline.info \
  284.           $(RLIBDOC)history.dvi $(RLIBDOC)history.info
  285.  
  286. /**/# This has to be written funny to avoid looking like a C comment starter.
  287. READLINE_EXAMPLES = $(RLIBSRC)examples/[a-zA-Z]*.c $(RLIBSRC)examples/Makefile
  288.  
  289. /**/# Support files for GNU Readline.
  290. READLINE_SUPPORT = $(RLIBSRC)Makefile $(RLIBSRC)ChangeLog $(RLIBSRC)COPYING \
  291.            $(READLINE_EXAMPLES) $(READLINE_DOC_SUPPORT)
  292.  
  293. #if defined (HAVE_READLINE_SOURCE)
  294. #define READLINE_LIBRARY ./readline/libreadline.a
  295. #else
  296. #define READLINE_LIBRARY -lreadline
  297. #endif
  298.  
  299. #if defined (USE_GNU_TERMCAP)
  300. #define HAVE_TERMCAP_SOURCE
  301. /**/# The source, object and documentation for the GNU Termcap library.
  302. TLIBSRC = $(LIBSRC)termcap/
  303. TLIBDOC = $(TLIBSRC)termcap.texinfo
  304. #define TERMCAP_LIBRARY ./termcap/libtermcap.a
  305.  
  306. TERMCAP_SOURCE    = $(TLIBSRC)termcap.c $(TLIBSRC)tparam.c
  307. TERMCAP_OBJ    = $(TLIBSRC)libtermcap.a
  308. TERMCAP_DOC    = $(TLIBSRC)termcap.texinfo
  309. TERMCAP_SUPPORT = $(TLIBSRC)Makefile $(TLIBSRC)ChangeLog
  310. TERMCAP_LDFLAGS = -L$(TLIBSRC)
  311. #endif /* USE_GNU_TERMCAP */
  312.  
  313. LIBRARY_SOURCE    = $(READLINE_SOURCE) $(TERMCAP_SOURCE)
  314. LIBRARY_DOC    = $(READLINE_DOC) $(HISTORY_DOC) $(TERMCAP_DOC)
  315. LIBRARY_SUPPORT    = $(READLINE_SUPPORT) $(TERMCAP_SUPPORT)
  316. LIBRARY_TAR    = $(LIBRARY_SOURCE) $(LIBRARY_DOC) $(LIBRARY_SUPPORT)
  317.  
  318. #if defined (READLINE)
  319. /**/# You wish to compile with the line editing features installed.
  320. READLINE_LIB = -lreadline
  321.  
  322. /* You only need termcap for readline. */
  323. #if defined (USE_TERMCAP_EMULATION)
  324. TERMCAP_LIB = -lcurses
  325. #else
  326. TERMCAP_LIB = -ltermcap
  327. #endif /* USE_TERMCAP_EMULATION */
  328.  
  329. /**/# Directory list for -L so that the loader can find -lreadline.
  330. #if defined (HAVE_READLINE_SOURCE)
  331. READLINE_LDFLAGS = -L$(RLIBSRC) $(TERMCAP_LDFLAGS)
  332. #else
  333. READLINE_LDFLAGS = -L/usr/gnu/lib -L/usr/local/lib $(TERMCAP_LDFLAGS)
  334. #endif /* HAVE_READLINE_SOURCE */
  335.  
  336. /**/# The source and object of the bash->readline interface code.
  337. RL_SUPPORT_SRC = bashline.c
  338. RL_SUPPORT_OBJ = bashline.o
  339. #endif /* READLINE */
  340.  
  341. #if defined (REQUIRED_LIBRARIES)
  342. /**/# Locally required libraries.
  343. LOCAL_LIBS = REQUIRED_LIBRARIES
  344. #endif /* REQUIRED_LIBRARIES */
  345.  
  346. /**/# The order is important.  Most dependent first.
  347. LIBRARIES = $(READLINE_LIB) $(TERMCAP_LIB) $(LOCAL_LIBS)
  348.  
  349. #if defined (HAVE_TERMCAP_SOURCE)
  350. TERMCAP_DEP = TERMCAP_LIBRARY
  351. #endif
  352.  
  353. #if defined (HAVE_READLINE_SOURCE)
  354. READLINE_DEP = READLINE_LIBRARY
  355. #endif
  356.  
  357. /**/# Source files for libraries that Bash depends on.
  358. LIBDEP = $(READLINE_DEP) $(TERMCAP_DEP)
  359.  
  360. /**/# Rules for cleaning the readline and termcap sources.
  361. #if defined (HAVE_READLINE_SOURCE)
  362. #define CLEAN_READLINE (cd $(RLIBSRC); $(MAKE) clean)
  363. #else
  364. #define CLEAN_READLINE :
  365. #endif
  366. #if defined (HAVE_TERMCAP_SOURCE)
  367. #define CLEAN_TERMCAP (cd $(TLIBSRC); $(MAKE) clean)
  368. #else
  369. #define CLEAN_TERMCAP :
  370. #endif
  371.  
  372. CSOURCES = shell.c parse.y general.c make_cmd.c print_cmd.c y.tab.c \
  373.        dispose_cmd.c execute_cmd.c variables.c builtins.c\
  374.        fc.c expr.c copy_cmd.c flags.c subst.c glob.c hash.c mailcheck.c\
  375.        test.c trap.c jobs.c nojobs.c $(ALLOC_FILES) braces.c\
  376.        unwind_prot.c siglist.c ulimit.c version.c $(RL_SUPPORT_SRC)
  377.  
  378. HSOURCES = shell.h flags.h trap.h hash.h jobs.h builtins.h alias.c y.tab.h \
  379.        alias.h general.h variables.h config.h $(ALLOC_HEADERS) \
  380.        quit.h ndir.h machines.h posixstat.h
  381.  
  382. SOURCES     = $(CSOURCES) $(HSOURCES)
  383.  
  384. OBJECTS     = shell.o y.tab.o general.o make_cmd.o print_cmd.o\
  385.        dispose_cmd.o execute_cmd.o variables.o builtins.o copy_cmd.o\
  386.        fc.o expr.o flags.o jobs.o subst.o glob.o hash.o mailcheck.o test.o\
  387.        trap.o alias.o $(MALLOC) $(ALLOCA) braces.o unwind_prot.o\
  388.        $(SIGLIST) ulimit.o version.o $(RL_SUPPORT_OBJ)
  389.  
  390. /**/# Documentation for the shell.
  391. DOCDIR = ./documentation/
  392. BASH_TEXINFO = $(DOCDIR)*.texi $(DOCDIR)*.tex \
  393.             $(DOCDIR)*.dvi $(DOCDIR)Makefile # $(DOCDIR)*.texinfo
  394. BASH_MAN = $(DOCDIR)bash.1
  395. BASHDOCS = $(BASH_TEXINFO) $(BASH_MAN) INSTALL README
  396. DOCUMENTATION = $(BASHDOCS) $(LIBRARY_DOC)
  397.  
  398. /**/# Some example files
  399. /* This has to be written funny to avoid looking like a comment starter. */
  400. EXAMPLES = examples/[a-zA-Z]*
  401.  
  402. ENDIAN_SUPPORT = endian.c
  403. PIPESIZE_SUPPORT = psize.c psize.sh
  404. SCRIPTS_SUPPORT = makeargs.sh cppmagic.sh make-tarfile mail-shell inform
  405.  
  406. CREATED_SUPPORT = endian.aux endian.h pipesize.h psize.aux sysdefs.h
  407.  
  408. SUPPORT = $(ENDIAN_SUPPORT) $(PIPESIZE_SUPPORT) $(SCRIPTS_SUPPORT) \
  409.       COPYING Makefile cpp-Makefile ChangeLog .distribution \
  410.       $(EXAMPLES) newversion.c
  411.  
  412. /**/# BAGGAGE consists of things that you want to keep with the shell for some
  413. /**/# reason, but do not actually use; old source code, etc.
  414. BAGGAGE = longest_sig.c
  415.  
  416. /**/# Things that the world at large needs.
  417. THINGS_TO_TAR = $(SOURCES) $(LIBRARY_TAR) $(BASHDOCS) $(SUPPORT) $(BAGGAGE)
  418.  
  419. /**/# Things that maintainers need, but no one else.
  420. MAINTAINENCE = shell-mail bash-distribution-list
  421.  
  422. all: .made
  423.  
  424. .made: $(PROGRAM)
  425.     cp .machine .made
  426.  
  427. $(PROGRAM):  .build $(OBJECTS) $(LIBDEP) .distribution
  428.     rm -f $@
  429.     $(CC) $(LDFLAGS) $(READLINE_LDFLAGS) -o $(PROGRAM) $(OBJECTS) $(LIBRARIES)
  430.  
  431. .build:    $(SOURCES) cpp-Makefile newversion.aux
  432.     if ./newversion.aux -build; then mv -f newversion.h version.h; fi
  433.     @echo
  434.     @echo "      ***************************************************"
  435.     @echo "      *                            *"
  436.     @echo "      * Making Bash for a $(MACHINE) running $(OS)."
  437.     @echo "      *                            *"
  438.     @echo "      ***************************************************"
  439.     @echo
  440.     @echo "$(PROGRAM) last made for a $(MACHINE) running $(OS)" >.machine
  441.  
  442. version.h:    newversion.aux
  443.     if ./newversion.aux -build; then mv -f newversion.h version.h; fi
  444.  
  445. shell.h:    general.h variables.h config.h quit.h
  446.         touch shell.h
  447.  
  448. jobs.h:        endian.h quit.h
  449.         touch jobs.h
  450.  
  451. variables.h:    hash.h
  452.         touch variables.h
  453.  
  454. /* If we are compiling with ALIAS defined, then this dependency makes sense. */
  455. #if defined (ALIAS)
  456. builtins.h:    alias.h
  457.         touch builtins.h
  458. #endif /* ALIAS */
  459.  
  460. y.tab.c:    parse.y shell.h
  461.         -if test -f y.tab.h; then mv -f y.tab.h old-y.tab.h; fi
  462.         $(BISON) -d parse.y
  463.         -if cmp -s old-y.tab.h y.tab.h; then mv old-y.tab.h y.tab.h; fi
  464.  
  465. #if defined (HAVE_READLINE_SOURCE)
  466. READLINE_LIBRARY: $(READLINE_SOURCE)
  467.     (cd $(RLIBSRC); $(MAKE) $(MFLAGS) CC='$(CC)' CFLAGS='$(CFLAGS)' RANLIB=$(RANLIB))
  468. #endif /* HAVE_READLINE_SOURCE */
  469.  
  470. #if defined (HAVE_TERMCAP_SOURCE)
  471. TERMCAP_LIBRARY: $(TERMCAP_SOURCE)
  472.     (cd $(TLIBSRC); $(MAKE) $(MFLAGS) CC='$(CC)' CFLAGS='$(CFLAGS) -I.' RANLIB=$(RANLIB))
  473. #endif /* USE_GNU_TERMCAP */
  474.  
  475. version.o:    version.h
  476.  
  477. shell.o:    shell.h flags.h shell.c posixstat.h
  478.         $(CC) $(CFG_FLAGS) $(CFLAGS) $(CPPFLAGS) -c shell.c
  479.  
  480. ulimit.o:    shell.h ulimit.c pipesize.h
  481.         $(CC) $(CFLAGS) -c ulimit.c
  482.  
  483. pipesize.h:    psize.aux
  484.     sh psize.sh > pipesize.h
  485.  
  486. psize.aux:    psize.c
  487.     $(CC) $(CFLAGS) -o $@ psize.c
  488.  
  489. endian.h:    endian.aux
  490.     ./endian.aux endian.h
  491.  
  492. endian.aux:    endian.c
  493.     $(CC) $(CFLAGS) -o $@ endian.c
  494.  
  495. #if defined (USE_GNU_MALLOC)
  496. #if !defined (__GNUC__)
  497. $(MALLOC):    $(ALLOC_FILES)
  498.         $(CC) -I$(ALLOC_DIR) $(CFLAGS) $(MALLOC_FLAGS) -c $*.c
  499.         @-mv `basename $*`.o $(MALLOC) 2>/dev/null
  500. #else
  501. $(MALLOC):    $(ALLOC_FILES)
  502.         $(CC) -I$(ALLOC_DIR) $(CFLAGS) $(MALLOC_FLAGS) -c $*.c
  503. #endif
  504. #endif /* USE_GNU_MALLOC */
  505.  
  506. #if !defined (HAVE_ALLOCA)
  507. $(ALLOCA):    $(ALLOCA_SOURCE)
  508.         $(CC) -I$(ALLOC_DIR) $(CFLAGS) -c $(ALLOCA_SOURCE)
  509.         @-mv `basename $*`.o $(ALLOCA) >/dev/null 2>&1
  510. #endif /* !HAVE_ALLOCA */
  511.  
  512. variables.o: shell.h hash.h flags.h
  513.     $(CC) -c $(CFLAGS) $(HOSTTYPE_DECL) variables.c
  514.  
  515. /* Dependencies for the main bash source. */
  516. braces.o: general.h
  517. builtins.o: shell.h hash.h jobs.h builtins.h trap.h flags.h
  518. copy_cmd.o: shell.h hash.h
  519. dispose_cmd.o: shell.h
  520. execute_cmd.o: shell.h y.tab.h posixstat.h builtins.h flags.h jobs.h
  521. expr.o: shell.h hash.h
  522. fc.o: shell.h hash.h builtins.h
  523. flags.o: flags.h config.h general.h quit.h
  524. general.o: shell.h
  525. glob.o: config.h
  526. hash.o: shell.h hash.h
  527. jobs.o: shell.h hash.h trap.h jobs.h
  528. mailcheck.o: posixstat.h variables.h hash.h quit.h
  529. make_cmd.o: shell.h flags.h
  530. parse.o: shell.h flags.h
  531. print_cmd.o: shell.h y.tab.h
  532. shell.o: shell.h flags.h
  533. subst.o: shell.h flags.h alias.h jobs.h
  534. test.o: posixstat.h
  535. trap.o: trap.h shell.h hash.h
  536. ulimit.o: variables.h quit.h pipesize.h
  537. unwind_prot.o: config.h general.h
  538.  
  539. #if defined (READLINE)
  540. bashline.o: shell.h hash.h builtins.h
  541. #endif
  542.  
  543. /* Dependencies which rely on the user using the source to READLINE. */
  544. #if defined (HAVE_READLINE_SOURCE)
  545. bashline.o: $(RLIBSRC)chardefs.h $(RLIBSRC)history.h $(RLIBSRC)readline.h
  546. bashline.o: $(RLIBSRC)keymaps.h $(RLIBSRC)history.h
  547. fc.o:     $(RLIBSRC)history.h
  548. parse.o: $(RLIBSRC)keymaps.h $(RLIBSRC)chardefs.h $(RLIBSRC)history.h
  549. parse.o: $(RLIBSRC)readline.h
  550. subst.o: $(RLIBSRC)history.h
  551. #endif /* HAVE_READLINE_SOURCE */
  552.  
  553. $(PROGRAM).tar: $(THINGS_TO_TAR) .distribution
  554.     ./make-tarfile $(PROGRAM) `cat .distribution` $(THINGS_TO_TAR)
  555.  
  556. $(PROGRAM).tar.Z:    $(PROGRAM).tar
  557.         compress -f $(PROGRAM).tar
  558.  
  559. clone:
  560.     mkdir clone; \
  561.     (cd clone; for i in $(THINGS_TO_TAR); \
  562.       do file=`basename $$i`; \
  563.        dir=`echo $$i | sed "s/$$file\$$//" | sed 's@\(.*\)/\$$@\1@'`; \
  564.        if [ "$$dir" = "" ]; then dir="."; fi; \
  565.        if [ "$$dir" != "." ]; then \
  566.           if [ ! -d "$$dir" ]; then mkdir "$$dir"; fi; \
  567.           if [ "$$file" = Makefile ]; \
  568.         then cp ../$$i $$i; \
  569.            else ln -s ../../$$i $$i; \
  570.           fi; \
  571.        else if [ "$$file" = Makefile ]; then cp ../$$i $$i; \
  572.          else ln -s ../$$i $$i; fi; \
  573.        fi; \
  574.       done)
  575.  
  576. install:    .made
  577.         if [ -f $(DESTDIR)/$(PROGRAM) ]; \
  578.         then mv $(DESTDIR)/$(PROGRAM) $(DESTDIR)/$(PROGRAM).old; \
  579.         fi
  580.         cp $(PROGRAM) $(DESTDIR)/$(PROGRAM)
  581.         rm -f installed-$(PROGRAM)
  582.         ln -s $(DESTDIR)/$(PROGRAM) installed-$(PROGRAM)
  583.  
  584. mailable:    distribution
  585.         /bin/rm -rf uuencoded
  586.         mkdir uuencoded
  587.         $(SHELL) -c 'f=$(PROGRAM)-`cat .distribution`.tar.Z;uuencode $$f $$f | split -800 - uuencoded/$$f.uu.'
  588.  
  589. .distribution:
  590.         ./newversion.aux -dist `./$(PROGRAM) -c 'echo $$BASH_VERSION'`
  591.  
  592. distribution:    $(PROGRAM) $(PROGRAM).tar.Z .distribution
  593.         @echo cp $(PROGRAM).tar.Z $(PROGRAM)-`cat .distribution`.tar.Z
  594.         @cp $(PROGRAM).tar.Z $(PROGRAM)-`cat .distribution`.tar.Z
  595.  
  596. newversion.aux:    newversion.c
  597.         $(CC) $(DEBUG_FLAGS) -o newversion.aux newversion.c -lm
  598.  
  599. newversion:    newversion.aux
  600.         rm -f .build
  601.         ./newversion.aux -dist
  602.         mv -f newversion.h version.h
  603.         make $(PROGRAM)
  604.  
  605. documentation:  documentation-frob
  606.         (cd $(DOCDIR); make)
  607.  
  608. documentation-frob:
  609.  
  610. tags:        $(SOURCES) $(LIBRARY_SOURCE)
  611.         etags $(SOURCES) $(LIBRARY_SOURCE)
  612.  
  613. INDEX:        $(SOURCES) $(LIBRARY_SOURCE)
  614.         ctags -x $(SOURCES) $(LIBRARY_SOURCE)
  615.  
  616. clean:
  617.         $(RM) $(OBJECTS) $(PROGRAM) *.aux
  618.         $(RM) .build .made version.h
  619.         $(RM) $(CREATED_SUPPORT)
  620.         $(RM) bash-Makefile
  621.         (cd $(DOCDIR); make clean)
  622.         CLEAN_READLINE;CLEAN_TERMCAP
  623.  
  624. /**/# Here is a convenient rule when you arrive at a new site and wish to
  625. /**/# install bash on several different architectures.  It creates a new
  626. /**/# directory to hold the results of compilatation.  The directory is
  627. /**/# named MACHINE-OS.
  628. architecture: $(MACHINE)-$(OS)/$(PROGRAM)
  629.  
  630. $(MACHINE)-$(OS):
  631.     mkdir $(MACHINE)-$(OS)
  632.  
  633. $(MACHINE)-$(OS)/$(PROGRAM): $(MACHINE)-$(OS) $(PROGRAM)
  634.     mv $(PROGRAM) $(MACHINE)-$(OS)
  635.     mv sysdefs.h $(MACHINE)-$(OS)
  636.     make clean
  637.